test(vt-server): fix the flaky dead-client test - #682
Merged
Conversation
`client_gone_before_reading_response_is_not_an_error` failed intermittently on Windows CI. On Windows a client reaches a pipe instance before the server's `accept` sees it, and this test's client waited for nothing before its work ended, so the connection could still be unaccepted when the harness signalled the server to stop accepting. The accept loop then had both the stop signal and the pending accept ready, and `tokio::select!` picks among ready branches at random; when the stop won, the server dropped that pipe instance with both frames unread, so the flag the test asserted was never recorded. Rebuild the test around what the server promises. The dying client's request is tracked, so the reports prove the handler ran. It reads only the answer's length prefix, which arrives only once the server has started writing a body far larger than any pipe buffer, so dropping the stream there always leaves that write with no reader. A second client, open across the death, is served both while the first is stuck and after it dies. The `DisableCache` frame this test used to piggyback on is gone: it rode on a connection about to die, which the server makes no promise about, and `raw_disable_cache_request_disables_cache` already covers that frame. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fspy benchmarklinuxmacoswindows |
wan9chi
added a commit
that referenced
this pull request
Aug 18, 2026
The two branches below moved onto current main, which brings in #682's vt_server fix along the way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> # Conflicts: # crates/fspy/src/ipc.rs # crates/fspy/src/unix/mod.rs # crates/fspy/src/windows/mod.rs # crates/vt_bin/tests/e2e_snapshots/fixtures/fspy_shm_capacity/snapshots.toml # crates/vt_bin/tests/e2e_snapshots/fixtures/fspy_shm_capacity/snapshots/shm_capacity_env_sizes_the_tracking_channel.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
client_gone_before_reading_response_is_not_an_errorfailed now and then on Windows CI (example run), and passed when the same commit was re-run. CLAUDE.md says the suite has no flaky tests.The two frames were not racing each other — the connection was never taken. On Windows a client gets the waiting pipe from the operating system before the server's
acceptsees it. This test's client waited for nothing, so it could finish while its connection was still unclaimed; the test helper then told the server to stop accepting, and with the stop and the waiting connection both ready, the server picks one at random. When the stop won, it dropped that pipe with both frames unread. Unix cannot land here, because a client there cannot finish connecting until the server has taken it.What changed
The test now checks what the server promises — a client that dies mid-answer ends only its own stream — with each step forced rather than timed:
The
DisableCacheframe it used to lean on is gone —raw_disable_cache_request_disables_cachealready covers that one. No production code changed.🤖 Generated with Claude Code